home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Bin / DXUtils / Visual Studio 6.0 Wizards / Source Code / DxAppWiz.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-12  |  1.0 KB  |  45 lines

  1. // DxAppWiz.cpp : Defines the initialization routines for the DLL.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <afxdllx.h>
  6. #include "DxAppWiz.h"
  7. #include "DXaw.h"
  8.  
  9. #ifdef _PSEUDO_DEBUG
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. static AFX_EXTENSION_MODULE DirectXDLL = { NULL, NULL };
  15.  
  16. HINSTANCE g_hInstance;
  17.  
  18. extern "C" int APIENTRY
  19. DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  20. {
  21.     g_hInstance = hInstance;
  22.  
  23.     if (dwReason == DLL_PROCESS_ATTACH)
  24.     {
  25.         TRACE0("DIRECTX.AWX Initializing!\n");
  26.         
  27.         // Extension DLL one-time initialization
  28.         AfxInitExtensionModule(DirectXDLL, hInstance);
  29.  
  30.         // Insert this DLL into the resource chain
  31.         new CDynLinkLibrary(DirectXDLL);
  32.  
  33.         // Register this custom AppWizard with MFCAPWZ.DLL
  34.         SetCustomAppWizClass(&DirectXaw);
  35.     }
  36.     else if (dwReason == DLL_PROCESS_DETACH)
  37.     {
  38.         TRACE0("DIRECTX.AWX Terminating!\n");
  39.  
  40.         // Terminate the library before destructors are called
  41.         AfxTermExtensionModule(DirectXDLL);
  42.     }
  43.     return 1;   // ok
  44. }
  45.